package com.wfms.bean;

import java.util.Optional;

/**
 * Created by chenlei on 2017/9/26.
 */
public class TestOption {

    public static  void  main(String[] args){
//        Optional<String> opt=Optional.ofNullable(null);
//        System.out.println(opt.get());

//        User user=new User("zhangsan",null);
//        Optional<User> userOpt=Optional.ofNullable(user);
//      String schoolName= userOpt.map(User::getUserClass)
//                .map(UserClass::getSchool)
//                .map(School::getName).orElse("default school");
//        System.out.println(schoolName);

    }

}
